package yesCaptcha

import (
	"context"
	"gitee.com/kaylee595/gkaylee/kerr"
)

type RespGetSoftId struct {
	BaseResponse
	SoftID  int     `json:"softID"`
	Balance float64 `json:"balance"`
}

func (c *Client) GetSoftId(ctx context.Context) (*RespGetSoftId, error) {
	const url = "/getSoftID"
	ret := &RespGetSoftId{}
	resp := c.httpClient.Post(url).SetBodyJsonMarshal(&BaseRequest{ClientKey: c.clientKey}).SetSuccessResult(ret).Do(ctx)
	if resp.Err != nil {
		return nil, kerr.WrapTraceStack(resp.Err)
	}
	if ret.IsError() {
		return nil, kerr.WrapTraceStack(ret)
	}
	return ret, nil
}
